package com.jyw.custom.huaxi.mos.config;

import com.jyw.custom.huaxi.mos.service.IHuaxiMosUserDetailsService;
import com.jyw.framework.security.MosAuthenticationSecurityConfig;
import com.jyw.framework.security.wechat.WechatAuthenticationProvider;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class HuaxiMosAuthenticationSecurityConfig extends MosAuthenticationSecurityConfig {


    @Resource
    private IHuaxiMosUserDetailsService mosUserDetailsService;

    @Override
    public void configure(HttpSecurity http) throws Exception {
        HuaxiMosAuthenticationProvider huaxiMosAuthenticationProvider = new  HuaxiMosAuthenticationProvider();
        huaxiMosAuthenticationProvider.setUserDetailsService(mosUserDetailsService);

        http.authenticationProvider(huaxiMosAuthenticationProvider);
    }
}
